package com.decent.common.entity.manager;

import com.decent.common.enums.manager.BannerTypeEnum;
import lombok.Data;
import lombok.ToString;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * Banner 图片
 * @author: decent Gjh
 * @date: 2022/10/24/15:08
 * @description:
 */
@Data
@ToString
public class SystemBanner {
    /**
     * bannerId
     */
    @Min(value = 1, message = "id不能小于1", groups = {Select.class, Delete.class})
    private Integer id;
    /**
     * banner绑定类型
     */
    @NotNull(message = "bannerType不能为null", groups = {Insert.class, Update.class})
    private BannerTypeEnum bannerType;
    /**
     * 图片url
     */
    @NotNull(message = "imageUrl不能为null", groups = {Update.class})
    private String imageUrl;
    /**
     * 绑定值
     */
    @NotEmpty(message = "value不能为空", groups = {Insert.class, Update.class})
    private String value;
    /**
     * 排序
     */
    @NotNull(message = "sort不能为空", groups = {Insert.class, Update.class})
    private Integer sort;

}
